package com.ty.user.starter.shiro.filter;

import com.ty.user.starter.util.ResponseUtil;
import org.apache.shiro.web.filter.authz.RolesAuthorizationFilter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class UserMgtRolesAuthorizationFilter extends RolesAuthorizationFilter {
    @Override
    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) {
        ResponseUtil.writer(response, 401, "没有需要的角色权限", null);
        return false;
    }
}
